/*
 * @Author: wushikang
 * @Date: 2021-10-25 11:01:20
 * @LastEditors: wushikang
 * @LastEditTime: 2021-10-25 14:45:32
 * @Description: 
 */
import request from '@/utils/request'
export default {
    namespaced: true,
    state(){
       return {
          user:{},
          roleName:'',
       }
    },
    mutations:{
           SET_VALUE(state,payload){
                state.user=payload;  
           },
           SET_ROLE(state,payload){
                 state.roleName=payload;
           }
    },
    actions:{
       async findAllUserData({commit},id){
         let res= await request.get('/baseUser/findUserDetailsById',{
            params:{
                id,
            }
         })
        commit('SET_VALUE',res.data);
        commit('SET_ROLE',res.data.roles[0].name)
        },
    },
}